package com.alibaba.dubbo.demo.provider;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.alibaba.dubbo.demo.DemoService;
import com.alibaba.dubbo.demo.Student;

public class DemoServiceImpl implements DemoService {

	private Logger logger = LoggerFactory.getLogger(DemoServiceImpl.class);

    @Override
    public Student sayHello(Student st) {
    	logger.info("produce1");
        try {
            Thread.sleep(300);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        String s = null;
        //s.indexOf(1);
        logger.info("say hello: " + st.getName());
        st.setAge(40);
        return st;
    }

	@Override
	public Student sayHello(String s) {
		Student st = new Student();
		st.setName(s);
		st.setAge(40);
		return st;
	}

	@Override
	public Student sayBye(Student st) {
		try {
            Thread.sleep(700);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("say bye: " + st.getName());
        st.setAge(40);
        return st;
	}

}
